package com.inplaceedit.client.ui.phone;

import com.google.gwt.text.shared.AbstractRenderer;
import com.inplaceedit.shared.dto.PhoneDto;

public class PhoneTypeRenderer extends AbstractRenderer<PhoneDto.Type> {
	private static PhoneTypeRenderer INSTANCE;

	public static PhoneTypeRenderer get() {
		if (INSTANCE == null) {
			INSTANCE = new PhoneTypeRenderer();
		}
		return INSTANCE;
	}

	private PhoneTypeRenderer() {
	}

	@Override
	public String render(final PhoneDto.Type object) {
		String result = "";
		if (object != null) {
			switch (object) {
			case HOME:
				result = "Home";
				break;
			case BUSINESS:
				result = "Business";
				break;
			case CELL:
				result = "Cell";
				break;
			default:
				break;
			}
		}
		return result;
	}
}
